local m = require('utils.vim')
local fk = vim.api.nvim_feedkeys

vim.cmd [[
  map m %
]]

m.map('n', 'w', 'W', { noremap = true })
m.map('n', 'W', 'w', { noremap = true })

m.map('n', 'b', 'B', { noremap = true })
m.map('n', 'B', 'b', { noremap = true })

m.map('n', 'e', 'E', { noremap = true })
m.map('n', 'E', 'e', { noremap = true })

m.map('n', '<space>e', 'gE', { noremap = true, silent = true, desc="skip cursor back to the end of the word" })

m.map("n","1h",function() fk("1h", "n", true) end)
m.map("n","2h",function() fk("2h", "n", true) end)
m.map("n","3h",function() fk("3h", "n", true) end)
m.map("n","4h",function() fk("4h", "n", true) end)
m.map("n","5h",function() fk("5h", "n", true) end)
m.map("n","6h",function() fk("6h", "n", true) end)
m.map("n","7h",function() fk("7h", "n", true) end)
m.map("n","8h",function() fk("8h", "n", true) end)
m.map("n","9h",function() fk("9h", "n", true) end)

m.map("n","1l",function() fk("1l", "n", true) end)
m.map("n","2l",function() fk("2l", "n", true) end)
m.map("n","3l",function() fk("3l", "n", true) end)
m.map("n","4l",function() fk("4l", "n", true) end)
m.map("n","5l",function() fk("5l", "n", true) end)
m.map("n","6l",function() fk("6l", "n", true) end)
m.map("n","7l",function() fk("7l", "n", true) end)
m.map("n","8l",function() fk("8l", "n", true) end)
m.map("n","9l",function() fk("9l", "n", true) end)

m.map("n","1k",function() fk("1k", "n", true) end)
m.map("n","2k",function() fk("2k", "n", true) end)
m.map("n","3k",function() fk("3k", "n", true) end)
m.map("n","4k",function() fk("4k", "n", true) end)
m.map("n","5k",function() fk("5k", "n", true) end)
m.map("n","6k",function() fk("6k", "n", true) end)
m.map("n","7k",function() fk("7k", "n", true) end)
m.map("n","8k",function() fk("8k", "n", true) end)
m.map("n","9k",function() fk("9k", "n", true) end)
m.map("n","10k",function() fk("10k", "n", true) end)
m.map("n","11k",function() fk("11k", "n", true) end)
m.map("n","12k",function() fk("12k", "n", true) end)
m.map("n","13k",function() fk("13k", "n", true) end)
m.map("n","14k",function() fk("14k", "n", true) end)
m.map("n","15k",function() fk("15k", "n", true) end)
m.map("n","16k",function() fk("16k", "n", true) end)
m.map("n","17k",function() fk("17k", "n", true) end)
m.map("n","18k",function() fk("18k", "n", true) end)
m.map("n","19k",function() fk("19k", "n", true) end)
m.map("n","20k",function() fk("20k", "n", true) end)
m.map("n","21k",function() fk("21k", "n", true) end)
m.map("n","22k",function() fk("22k", "n", true) end)
m.map("n","23k",function() fk("23k", "n", true) end)
m.map("n","24k",function() fk("24k", "n", true) end)
m.map("n","25k",function() fk("25k", "n", true) end)
m.map("n","26k",function() fk("26k", "n", true) end)
m.map("n","27k",function() fk("27k", "n", true) end)
m.map("n","28k",function() fk("28k", "n", true) end)
m.map("n","29k",function() fk("29k", "n", true) end)
m.map("n","30k",function() fk("30k", "n", true) end)
m.map("n","31k",function() fk("31k", "n", true) end)
m.map("n","32k",function() fk("32k", "n", true) end)
m.map("n","33k",function() fk("33k", "n", true) end)
m.map("n","34k",function() fk("34k", "n", true) end)
m.map("n","35k",function() fk("35k", "n", true) end)
m.map("n","36k",function() fk("36k", "n", true) end)
m.map("n","37k",function() fk("37k", "n", true) end)
m.map("n","38k",function() fk("38k", "n", true) end)
m.map("n","39k",function() fk("39k", "n", true) end)
m.map("n","40k",function() fk("40k", "n", true) end)
m.map("n","41k",function() fk("41k", "n", true) end)
m.map("n","42k",function() fk("42k", "n", true) end)
m.map("n","43k",function() fk("43k", "n", true) end)
m.map("n","44k",function() fk("44k", "n", true) end)
m.map("n","45k",function() fk("45k", "n", true) end)
m.map("n","46k",function() fk("46k", "n", true) end)
m.map("n","47k",function() fk("47k", "n", true) end)
m.map("n","48k",function() fk("48k", "n", true) end)
m.map("n","49k",function() fk("49k", "n", true) end)

m.map("n","1j",function() fk("1j", "n", true) end)
m.map("n","2j",function() fk("2j", "n", true) end)
m.map("n","3j",function() fk("3j", "n", true) end)
m.map("n","4j",function() fk("4j", "n", true) end)
m.map("n","5j",function() fk("5j", "n", true) end)
m.map("n","6j",function() fk("6j", "n", true) end)
m.map("n","7j",function() fk("7j", "n", true) end)
m.map("n","8j",function() fk("8j", "n", true) end)
m.map("n","9j",function() fk("9j", "n", true) end)
m.map("n","10j",function() fk("10j", "n", true) end)
m.map("n","11j",function() fk("11j", "n", true) end)
m.map("n","12j",function() fk("12j", "n", true) end)
m.map("n","13j",function() fk("13j", "n", true) end)
m.map("n","14j",function() fk("14j", "n", true) end)
m.map("n","15j",function() fk("15j", "n", true) end)
m.map("n","16j",function() fk("16j", "n", true) end)
m.map("n","17j",function() fk("17j", "n", true) end)
m.map("n","18j",function() fk("18j", "n", true) end)
m.map("n","19j",function() fk("19j", "n", true) end)
m.map("n","20j",function() fk("20j", "n", true) end)
m.map("n","21j",function() fk("21j", "n", true) end)
m.map("n","22j",function() fk("22j", "n", true) end)
m.map("n","23j",function() fk("23j", "n", true) end)
m.map("n","24j",function() fk("24j", "n", true) end)
m.map("n","25j",function() fk("25j", "n", true) end)
m.map("n","26j",function() fk("26j", "n", true) end)
m.map("n","27j",function() fk("27j", "n", true) end)
m.map("n","28j",function() fk("28j", "n", true) end)
m.map("n","29j",function() fk("29j", "n", true) end)
m.map("n","30j",function() fk("30j", "n", true) end)
m.map("n","31j",function() fk("31j", "n", true) end)
m.map("n","32j",function() fk("32j", "n", true) end)
m.map("n","33j",function() fk("33j", "n", true) end)
m.map("n","34j",function() fk("34j", "n", true) end)
m.map("n","35j",function() fk("35j", "n", true) end)
m.map("n","36j",function() fk("36j", "n", true) end)
m.map("n","37j",function() fk("37j", "n", true) end)
m.map("n","38j",function() fk("38j", "n", true) end)
m.map("n","39j",function() fk("39j", "n", true) end)
m.map("n","40j",function() fk("40j", "n", true) end)
m.map("n","41j",function() fk("41j", "n", true) end)
m.map("n","42j",function() fk("42j", "n", true) end)
m.map("n","43j",function() fk("43j", "n", true) end)
m.map("n","44j",function() fk("44j", "n", true) end)
m.map("n","45j",function() fk("45j", "n", true) end)
m.map("n","46j",function() fk("46j", "n", true) end)
m.map("n","47j",function() fk("47j", "n", true) end)
m.map("n","48j",function() fk("48j", "n", true) end)
m.map("n","49j",function() fk("49j", "n", true) end)

m.map("n","2v",function() fk("v1l", "n", true) end)
m.map("n","3v",function() fk("v2l", "n", true) end)
m.map("n","4v",function() fk("v3l", "n", true) end)
m.map("n","5v",function() fk("v4l", "n", true) end)
m.map("n","6v",function() fk("v5l", "n", true) end)
m.map("n","7v",function() fk("v6l", "n", true) end)
m.map("n","8v",function() fk("v7l", "n", true) end)
m.map("n","9v",function() fk("v8l", "n", true) end)

m.map("n",'<M-`>',function()
    fk('^f`l', "n", true)
end,{desc="move cursor to text inside `"})
m.map("n",'<M-">',function()
    fk('^f"l', "n", true)
end,{desc='move cursor to text inside "'})
m.map("n","<M-'>",function()
    fk("^f'l", "n", true)
end,{desc="move cursor to text inside '"})
m.map("n","<M-(>",function()
    fk("^f(l", "n", true)
end,{desc="move cursor to text inside ("})

-- EOP
